# Define programs and commands.
CPP = g++

# Target file name (without extension).
TARGET = archi

# List any extra directories to look for include files here.
#     Each directory must be seperated by a space.
#     Use forward slashes for directory separators.
#     For a directory that has spaces, enclose it in quotes.
INCDIRS = include

#---------------- Profiling Options ----------------
#GPROF_FLAGS = -g -pg
#---------------- Compiler Options ----------------
CPPFLAGS = -Wall -pedantic
CPPFLAGS += -I $(INCDIRS)

ALL_CPPFLAGS = $(GRPOF_FLAGS) -c $(CPPFLAGS)


#---------------- Library Options ----------------
LIBS = 

#---------------- Linker Options ----------------
LFLAGS = $(GRPOF_FLAGS) $(LIBS)



# List C++ source files here.
SRC = $(wildcard src/*.cpp) $(wildcard *cpp)


# Define bin target directory 
BINDIR = /usr/local/bin
FULL_TARGET = $(BINDIR)/$(TARGET)

# Define all object files.
OBJ = $(SRC:.cpp=.o)


# Default
default: $(TARGET)

$(TARGET): $(OBJ)
	$(CPP) $(LFLAGS) $^ -o $@

# Compile: create object files from C source files.
%.o: %.cpp
	$(CPP) $(ALL_CPPFLAGS) $< -o $@

profile:
	$(MAKE) $(MAKEFILE) GRPOF_FLAGS="-g -pg"

clean:
	rm -rf $(OBJ) $(TARGET)

install:
	install -m 0755 -T $(TARGET) $(FULL_TARGET)

uninstall:
	rm -rf $(FULL_TARGET)

.PHONY: install

